package models

import (
	"github.com/astaxie/beego/orm"
)

type Languagetext struct {
	Id      int
	Keyword string
	Text    string
}

func init() {
	// 需要在init中注册定义的model
	orm.RegisterModel(new(Languagetext))
}

func Language_text() ([]orm.Params, int64, error) {
	o := orm.NewOrm()
	var data []orm.Params
	num, err := o.QueryTable("languagetext").Values(&data)
	return data, num, err
}

//func InsertInventory(name string, flname string) (int64, error) {
//	o := orm.NewOrm()
//	var datas Inventory
//	datas.Flname = flname
//	datas.Name = name
//	id, err := o.Insert(&datas)
//	return id, err
//}

//func Inventorylist() ([]orm.Params, int64, error) {
//	o := orm.NewOrm()
//	var data []orm.Params
//	num, err := o.QueryTable("inventory").Values(&data)
//	return data, num, err
//}

//func Inventorydel(id int) (int64, error) {
//	o := orm.NewOrm()
//	num, err := o.QueryTable("inventory").Filter("id", id).Delete()
//	return num, err
//}

//func Inventory_update_data(id int) ([]orm.Params, int64, error) {
//	o := orm.NewOrm()
//	var data []orm.Params
//	num, err := o.QueryTable("inventory").Filter("id", id).Values(&data)
//	return data, num, err
//}

//func Inventoryupdate(id int, flname string, num int, name string) (int64, error) {
//	o := orm.NewOrm()
//	info, err := o.QueryTable("inventory").Filter("id", id).Update(orm.Params{
//		"name": name, "flname": flname, "num": num,
//	})
//	return info, err
//}

//func InventoryTree(flname string) ([]orm.Params, int64, error) { //三级分类  商品名称数据
//	query := orm.NewOrm()
//	var data []orm.Params
//	number, err := query.QueryTable("inventory").Filter("flname", flname).Values(&data, "Name")
//	return data, number, err
//}
